package system

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type SeckillOrderRouter struct{}

func (s *SeckillOrderRouter) InitSeckillOrderRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	seckillOrderRouter := Router.Group("seckillOrder").Use(middleware.OperationRecord())
	seckillOrderRouterWithoutRecord := Router.Group("seckillOrder")
	seckillOrderRouterWithoutAuth := PublicRouter.Group("seckillOrder")
	{
		seckillOrderRouter.POST("createSeckillOrder", seckillOrderApi.CreateSeckillOrder)
		seckillOrderRouter.DELETE("deleteSeckillOrder", seckillOrderApi.DeleteSeckillOrder)
		seckillOrderRouter.DELETE("deleteSeckillOrderByIds", seckillOrderApi.DeleteSeckillOrderByIds)
		seckillOrderRouter.PUT("updateSeckillOrder", seckillOrderApi.UpdateSeckillOrder)
	}
	{
		seckillOrderRouterWithoutRecord.GET("findSeckillOrder", seckillOrderApi.FindSeckillOrder)
		seckillOrderRouterWithoutRecord.GET("getSeckillOrderList", seckillOrderApi.GetSeckillOrderList)
	}
	{
		seckillOrderRouterWithoutAuth.GET("getSeckillOrderPublic", seckillOrderApi.GetSeckillOrderPublic)
		seckillOrderRouterWithoutAuth.POST("seckillOrderPay", seckillOrderApi.SeckillOrderPay)
		seckillOrderRouterWithoutAuth.POST("alipayNotify", seckillOrderApi.AlipayNotify)
		seckillOrderRouterWithoutAuth.POST("handlePaymentSuccess", seckillOrderApi.HandlePaymentSuccessManually)
		seckillOrderRouterWithoutAuth.POST("rollbackUnusedStock", seckillOrderApi.RollbackUnusedStock)
	}
}
